home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 234_01 / testprt.asm < prev    next >
Encoding:
Assembly Source File  |  1987-06-16  |  1.3 KB  |  39 lines

  1. ;
  2. ;______________________________________________________________________
  3. ;
  4. ; testprt.asm
  5. ; from PC Magazine 6/24/86
  6. ; test availability of printer -1 ready -0 not ready                  |
  7. ;_____________________________________________________________________|
  8. ;
  9. ;lpt1stat - checks the current status of LPT1
  10. ;
  11.                    include pro.h
  12.  
  13. $b$prog            segment public 'code'
  14.                    public _testprt
  15. _testprt           proc near
  16.                    push bp
  17.                    mov  bp,sp
  18.                    push di
  19.                    push si
  20.                    push dx
  21.                    mov  dx,0
  22.                    mov  ah,2
  23.                    int  17h
  24.                    test ah,8
  25.                    je   stat1            ;printer available
  26.                    mov  ax,0             ;indicate error
  27.                    jmp  short done
  28. stat1:             mov  ax,1             ;printer available
  29.                    jmp  short done
  30. done:              pop  dx
  31.                    pop  si
  32.                    pop  di
  33.                    pop  bp
  34.                    ret
  35. _testprt           endp
  36. $b$prog            ends
  37.                    end
  38.  
  39.